Extracting Object Histories
The Extract Object History as Macro feature lets you extract macros that can be played to understand the history of an object or to create new objects from complex scenarios that make use of multiple tools.

When a new session is started or a session is loaded, the tag “Session started” is added to the Action log with the current date and time. This serves as the session ID. If objects are loaded, the identity of those objects (GUID) are written in a starting inventory in the Action log, with logger variable names.
The session history is saved whenever a session is saved, and includes everything from the end of the Action log up to the last “Session started” entry. The starting inventory is also saved, as well as the ending inventory, with the identity of the objects saved with the session (GUID) and the logger variable names. You should note that when a session is loaded, the past history is recovered and the history of the current session is kept as a separate history.
When an object history is extracted, the whole history of the session is taken from the end to the beginning, one session history at a time:
- The text of the current Action Log is taken and separated in a macro.
- The name of the variable (for example, “ROI-05”) to extract from the Action Log is obtained from the GUID found in the ending inventory.
- The blocks are analyzed from the end to the beginning and for each block, the following are retrieved:
- The non-constant declared input variables.
- The names of the variables part of non-constant declared input variable collections.
- The assigned variables.
- The declared output variables.
- The assignments of declared output variables collections.
- If there is at least one of these names found in the dependence, that block is kept as follows:
The full block is kept “as is”, unless only assignments are required, in which case the code is stripped to keep only pure assignments, or loading occurs, in which case the assignment is replaced by a call to an macro block with the UUID of the macro of the history of that object.
The declared input variables and the names found in the declared input variables collections are added in the set of dependent variables to look for in preceding blocks.
The declared input variables, the names of variables found in declared input variable collections, the declared outputs variables and the names of the variables found as assignments of declared output variable collections are added in a set of variables that could be deleted.

- Create or modify the required object with Dragonfly’s extensive toolset.
For example, you could experiment with a recipe that creates regions of interest within selected ranges and then overwrites them on a small portion of a dataset.
- Right-click the required object in the Data Properties and Settings panel and then choose Extract Object History as a Macro in the pop-up menu.
A macro is generated with the name “Filtered session history of session YYYY-MM-DD-HH-MM-SS for object xx”, where object xx is the item from which the history was extracted.
- Open the Macro Player.
The macro can be edited, if required, and then played (see Recording and Playing Macros).
Note If your experiment was applied to a small portion of a dataset, you can remove the cropping block so that the logged operations are applied to the full dataset.

The preference, Keep object history, which is available in the Miscellaneous settings, lets you save an object's history in exported *.ORSObject formatted files. You should note that saving object histories can time-consuming and that the GUID of all objects is always preserved when a session is saved or loaded.